'use strict'

const axios = require('axios')

const BASE_URL = process.env.DUJN_CLI_TEST_BASE_URL ? process.env.DUJN_CLI_TEST_BASE_URL : 'http://ldjun.cn:7005'

const request = axios.create({
  baseURL: BASE_URL,
  timeout: 5000,
})

request.interceptors.response.use(
  (response) => response.data,
  (error) => Promise.reject(error)
)

module.exports = request
